import 'core-js/es6/promise';
// import axios from 'axios';
import Vue from 'vue';
import VRouter from 'vue-router';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(ElementUI);
Vue.use(VRouter);

const login = resolve => require(['@/component/login.vue'], resolve);
const basic = resolve => require(['@/component/basic.vue'], resolve);
Vue.config.productionTip = false;

const router = new VRouter({
    routes: [
       /* {path: '*', redirect: '/basic2'},*/
        // 商品管理
        {name: 'basic', path: '/basic', component: basic},
        {name: 'login', path: '/login', component: login},
    ]
});
new Vue({
    el: '#app',
    router,
    data: function () {
        const item = {
            date: '2016-05-02',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1518 弄'
        };
        return {
            tableData: Array(20).fill(item)
        }
    },
    methods: {
        handleSelect(key, keyPath) {
            console.log("===================","w323")
            console.log(this);
            console.log(key);
            console.log(keyPath);
            //控制导航页的页面跳转
            this.$router.push(keyPath);
            // console.log(key, keyPath);

        },
        skip(a) {
            console.log(a);
            this.$router.push(a)
        }
    }

});

